﻿using System.IO;
using Styx;
using Styx.Helpers;
using System.ComponentModel;
using DefaultValue = Styx.Helpers.DefaultValueAttribute;
using Styx.Common;
using Styx.Common.Helpers;
using System.Windows.Forms;
using System.Reflection;

namespace KingWoW
{
    [Obfuscation(Exclude = true)] 
    public class HolyPriestSettings : Settings
    {
        public static HolyPriestSettings Instance = new HolyPriestSettings();

        public string path_name = Path.Combine(Styx.Common.Utilities.AssemblyDirectory, string.Format(@"KingWOWCurrentSettings/HolyPriest/HolyPriest-Settings-{0}.xml", StyxWoW.Me.SafeName));

        public HolyPriestSettings()
            : base(Path.Combine(Styx.Common.Utilities.AssemblyDirectory, string.Format(@"KingWOWCurrentSettings/HolyPriest/HolyPriest-Settings-{0}.xml", StyxWoW.Me.SafeName)))
        {
        }

        [Setting]
        [DefaultValue(false)]
        [Category("MOVEMENT")]
        [DisplayName("Auto Move")]
        [Description("Enable/disable CC movement")]
        public bool movementEnabled { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("SOS")]
        [DisplayName("use SoS routine")]
        [Description("Interrupt any other spell cast (except SpiritShell) if anyone lower than SoS heal % hp")]
        public bool SoSEnabled { get; set; }

        [Setting]
        [DefaultValue(40)]
        [Category("SOS")]
        [DisplayName("SoS hp%")]
        [Description("Cast SoS heal if anyone in party lower than % hp")]
        public int SoSPercent { get; set; } 
    
        [Setting]
        [DefaultValue(true)]
        [Category("SOS")]
        [DisplayName("UseShieldOnSoSPercent")]
        [Description("Cast PW:Shield on SoS heal")]
        public bool UseShieldOnSoSPercent { get; set; } 
        

        [Setting]
        [DefaultValue(28)]
        [Category("PULL")]
        [DisplayName("PullDistance")]
        [Description("Distance to pull from")]
        public float PullDistance { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("MOVEMENT")]
        [DisplayName("AutoFacingTarget")]
        [Description("Enable/Disable autofacing current AttackTarget")]
        public bool AutofaceTarget { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("SELF HEALING")]
        [DisplayName("Enabled Self Healing Priority")]
        [Description("Enable/Disable Self Healing Priority: HP% is set below")]
        public bool SelfHealingPriorityEnabled { get; set; }

        [Setting]
        [DefaultValue(50)]
        [Category("SELF HEALING")]
        [DisplayName("SelfHealingPriorityHP")]
        [Description("if enabled Self Healing Priority: healing you before other in party until below this HP%")]
        public float SelfHealingPriorityHP { get; set; }

        [Setting]
        [DefaultValue(Rotation.PVE)]
        [Category("ROTATION")]
        [DisplayName("Rotation Type")]
        [Description("use PVE or PVP or QUESTING rotation tipe")]
        public Rotation RotationType { get; set; }

        public enum Rotation
        {
            PVE,
            PVP,
            QUESTING
        }

        public enum ChakraType
        {
            CHASTISE,
            SANCTUARY,
            SERENITY,
            AUTO
        }

        [Setting]
        [DefaultValue(true)]
        [Category("PRAYER OF MENDING")]
        [DisplayName("Use Preyer of Mending")]
        [Description("Enable/Disable Preyer of Mending")]
        public bool Use_PoM { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("PRAYER OF MENDING")]
        [DisplayName("Use Preyer of Mending Only On Tank")]
        [Description("Use Preyer of Mending Only On Tank")]
        public bool Use_PoM_Only_On_Tank { get; set; }

        /*[Setting]
        [DefaultValue(true)]
        [Category("PRAYER OF MENDING")]
        [DisplayName("Use Preyer of Mending On Cooldown")]
        [Description("Use Preyer of Mending On Cooldown")]
        public bool Use_PoM_On_Cooldown { get; set; }*/

        /*[Setting]
        [DefaultValue(100)]
        [Category("PRAYER OF MENDING")]
        [DisplayName("Preyer of Mending at HP%")]
        [Description("Use Preyer of Mending on this HP percentage")]
        public int PoM_HP { get; set; }*/


        [Setting]
        [DefaultValue(ChakraType.SERENITY)]
        [Category("BUFF")]
        [DisplayName("Use Chakra")]
        [Description("chose Chakra to use")]
        public ChakraType ChakraToUse { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("BUFF")]
        [DisplayName("Auto PW:Fortitude")]
        [Description("Cast Automaticaly PW:Fortitude on party")]
        public bool AutoPWFortitude { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("MOVEMENT")]
        [DisplayName("Use talent for speed on moving")]
        [Description("chose to use AngelicFaether/PW:Shield if talented and if moving in combat or when MoveTimeForSpeedBuff condition OutOfCombat is verified")]
        public bool BurstSpeedMoving { get; set; }

        [Setting]
        [DefaultValue(500)]
        [Category("MOVEMENT")]
        [DisplayName("MoveTimeForSpeedBuff")]
        [Description("If OutOfCombat will cast movement spell buff if you move without changing direction for a time greater than this value in Milliseconds")]
        public int MoveTimeForSpeedBuff { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("BUFF")]
        [DisplayName("Use AutoCastLightwell")]
        [Description("AutoCastLightwell in your position in combat")]
        public bool AutoCastLightwell { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("BUFF")]
        [DisplayName("Use Lightwell Only On Boss")]
        [Description("AutoCastLightwell only on BOSS")]
        public bool LightwellOnlyOnBoss { get; set; }
        

        [Setting]
        [DefaultValue(true)]
        [Category("DISPELLS")]
        [DisplayName("Use Purify ")]
        [Description("Use Purify for cure disease and dispell magic")]
        public bool UsePurify { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("DISPELLS")]
        [DisplayName("UseMassDispell ")]
        [Description("Use MassDispell for cure disease and dispell magic on many players")]
        public bool UseMassDispell { get; set; }

        [Setting]
        [DefaultValue(3)]
        [Category("DISPELLS")]
        [DisplayName("Mass Dispell Count")]
        [Description("Set number of dispellable players for Mass Dispell")]
        public int MassDispellCount { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("SPECIAL")]
        [DisplayName("AutoDismountOnCombat")]
        [Description("Auto start combat rotation when in combat and mounted")]
        public bool AutoDismountOnCombat { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("NPC_HEALING")]
        [DisplayName("HealNPC")]
        [Description("Enable/Disable heal on NPC (enable in provinGround or in some specific encounter when you need to heal Unit that are not in your party/raid")]
        public bool HealNPC { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("NPC_HEALING")]
        [DisplayName("FullHealSelectedNPC")]
        [Description("when HealNPC is selected if you enable this option then CR will try to full the selected friendly NPC you target")]
        public bool FullSelectedNPC { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("SPECIAL")]
        [DisplayName("Use Resurrection")]
        [Description("enable use of Resurrection out of combat")]
        public bool UseResurrection { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("SPECIAL")]
        [DisplayName("use OOC healing")]
        [Description("enable-disable use of OutOfCombat healing")]
        public bool OOCHealing { get; set; }

        [Setting]
        [DefaultValue(25)]
        [Category("CD")]
        [DisplayName("Guardian Spirit hp%")]
        [Description("Cast Guardian Spirit at AttackTarget % hp")]
        public int GuardianSpiritPercent { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("CD")]
        [DisplayName("Guardian Spirit ONLY on tanks")]
        [Description("Cast Guardian Spirit only on tanks")]
        public bool GuardianSpiritOnlyOnTanks { get; set; }
        

        [Setting]
        [DefaultValue(false)]
        [Category("BUFF")]
        [DisplayName("Use Fear Ward")]
        [Description("enable use of Fear Ward on CD")]
        public bool UseFearWard { get; set; }

        [Setting]
        [DefaultValue(90)]
        [Category("HEAL TUNING")]
        [DisplayName("Heal hp% NO serendipity")]
        [Description("Cast Heal at Target % hp and NO serendipity buff")]
        public int HealPercent { get; set; }

        [Setting]
        [DefaultValue(80)]
        [Category("HEAL TUNING")]
        [DisplayName("Heal hp% with 1 serendipity")]
        [Description("Cast Heal at Target % hp with 1 serendipity")]
        public int HealPercent1Serendipity { get; set; }

        [Setting]
        [DefaultValue(70)]
        [Category("HEAL TUNING")]
        [DisplayName("Heal hp% with 2 serendipity")]
        [Description("Cast Heal at Target % hp with 2 serendipity")]
        public int HealPercent2Serendipity { get; set; }

        [Setting]
        [DefaultValue(40)]
        [Category("HEAL TUNING")]
        [DisplayName("Flash Heal hp% NO serendipity")]
        [Description("Cast Flash Heal at Target % hp and NO serendipity buff")]
        public int FlashHealPercent { get; set; }

        [Setting]
        [DefaultValue(50)]
        [Category("HEAL TUNING")]
        [DisplayName("Flash Heal hp% with 1 serendipity")]
        [Description("Cast Flash Heal at Target % hp with 1 serendipity buff")]
        public int FlashHealPercent1Serendipity { get; set; }

        [Setting]
        [DefaultValue(60)]
        [Category("HEAL TUNING")]
        [DisplayName("Flash Heal hp% with 2 serendipity")]
        [Description("Cast Flash Heal at Target % hp with 2 serendipity buff")]
        public int FlashHealPercent2Serendipity { get; set; }

        [Setting]
        [DefaultValue(60)]
        [Category("HEAL TUNING")]
        [DisplayName("Binding heal hp%")]
        [Description("Cast Binding Heal if AttackTarget and me hp % lower than this value")]
        public int BindingHealPercent { get; set; }

        [Setting]
        [DefaultValue(75)]
        [Category("MANA REGENERATION")]
        [DisplayName("ShadowFiend/Mindbender mana%")]
        [Description("Cast ShadowFiend/Mindbender at % mana")]
        public int ShadowFiendPercent { get; set; }

        public enum CDUseType
        {
            COOLDOWN,
            BOSS,
            MANUAL
        }

        [Setting]
        [DefaultValue(CDUseType.COOLDOWN)]
        [Category("MANA REGENERATION")]
        [DisplayName("Use Pet on")]
        [Description("Chose when use your Pet")]
        public CDUseType CDUsePet { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("MANA MANAGEMENT")]
        [DisplayName("TrySaveMana")]
        [Description("Try save mana: interrupt no needed heal")]
        public bool TrySaveMana { get; set; }

        [Setting]
        [DefaultValue(95)]
        [Category("HEAL TUNING")]
        [DisplayName("HW: Serenity hp%")]
        [Description("Cast HW: Serenity at AttackTarget % hp")]
        public int HWSerenityPercent { get; set; }

        /*[Setting]
        [DefaultValue(4)]
        [Category("ROTATION")]
        [DisplayName("FlashHeal_VS_Heal_PlayerNumber")]
        [Description("Set number of player below HealHP% to go in emergency! for serendipity buid")]
        public int FlashVSNormalHealPlayerNumber { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("ROTATION")]
        [DisplayName("FlashHeal_VS_Heal_PlayerNumber_Enabled")]
        [Description("Enable/disable use of variable FlashVSNormalHealPlayerNumber (set to false for mana issue! Enable in instance!")]
        public bool FlashVSNormalHealPlayerNumberEnabled { get; set; }
        
        [Setting]
        [DefaultValue(false)]
        [Category("AOE HEAL")]
        [DisplayName("DisableAOE_HealingRotation")]
        [Description("Enable/disable AOE healing")]
        public bool DisableAOE_HealingRotation { get; set; }*/

        [Setting]
        [DefaultValue(95)]
        [Category("AOE HEAL")]
        [DisplayName("HW: Sanctuary hp%")]
        [Description("Cast HW: Sanctuary if Player below %h >= HWSanctuaryNumber")]
        public int HWSanctuaryPercent { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("AOE HEAL")]
        [DisplayName("HWSanctuaryOnlyOnHotkey")]
        [Description("Use HW: Sanctuary ONLY when HOTKEY button pressed at current mouse location")]
        public bool HWSanctuaryOnlyOnHotkey { get; set; }      

        [Setting]
        [DefaultValue(3)]
        [Category("AOE HEAL")]
        [DisplayName("HW: Sanctuary players number")]
        [Description("Cast HW: Sanctuary if Player below HWSanctuaryPercent >= this number")]
        public int HWSanctuaryNumber { get; set; }

        /*[Setting]
        [DefaultValue(90)]
        [Category("AOE HEAL")]
        [DisplayName("Divine Insight--->PreyerOfMending hp%")]
        [Description("Cast PreyerOfMending on proc of Divine Insight if Player below %h >= PrayerOfMendingNumber")]
        public int PrayerOfMendingPercent { get; set; }

        [Setting]
        [DefaultValue(2)]
        [Category("AOE HEAL")]
        [DisplayName("Divine Insight--->PreyerOfMending players number")]
        [Description("Cast PreyerOfMending if Player below PrayerOfMendingPercent >= this number")]
        public int PrayerOfMendingNumber { get; set; }*/

        [Setting]
        [DefaultValue(95)]
        [Category("AOE HEAL")]
        [DisplayName("Circle of Healing hp%")]
        [Description("Cast CircleOfHealing if Player below hp% >= CircleOfHealingNumber")]
        public int CircleOfHealingPercent { get; set; }

        [Setting]
        [DefaultValue(2)]
        [Category("AOE HEAL")]
        [DisplayName("Circle of Healing players number")]
        [Description("Cast CircleOfHealing if Player below CircleOfHealingPercent >= this number")]
        public int CircleOfHealingNumber { get; set; }

        [Setting]
        [DefaultValue(50)]
        [Category("AOE HEAL")]
        [DisplayName("Divine Hymn hp%")]
        [Description("Cast Divine Hymn if Player below %h >= DHNumber")]
        public int DHPercent { get; set; }

        [Setting]
        [DefaultValue(5)]
        [Category("AOE HEAL")]
        [DisplayName("Divine Hymn players number")]
        [Description("Cast Divine Hymn if Player below DHPercent >= this number")]
        public int DHNumber { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("AOE HEAL")]
        [DisplayName("HW: Sanctuary on TANK")]
        [Description("Cast HW: Sanctuary if Player below HWSerenityPercent NEAR TANK >= HWSanctuaryNumber")]
        public bool HWSanctuaryOnTank { get; set; }

        [Setting]
        [DefaultValue(95)]
        [Category("HEAL TUNING")]
        [DisplayName("Surge of Ligth %hp")]
        [Description("Cast Surge of Ligth if player hp < %. SoL will cast on lower hp player same if buff ending")]
        public int SoLPercent { get; set; }

        [Setting]
        [DefaultValue(70)]
        [Category("CD")]
        [DisplayName("Power Infusion hp%")]
        [Description("Cast Power Infusion to empower healing if number of player lower than %hp >= PowerInfusionNumber")]
        public int PowerInfusionPercent { get; set; }

        [Setting]
        [DefaultValue(3)]
        [Category("CD")]
        [DisplayName("Power Infusion players number")]
        [Description("Cast Power Infusion to empower healing if number of player lower than PowerInfusionPercent hp% >= this value")]
        public int PowerInfusionNumber { get; set; }

        [Setting]
        [DefaultValue(60)]
        [Category("CD")]
        [DisplayName("Power Infusion mana%")]
        [Description("Cast Power Infusion to lower mana cost spell if our mana is lower than this value")]
        public int PowerInfusionManaPercent { get; set; }

        [Setting]
        [DefaultValue(40)]
        [Category("CD")]
        [DisplayName("Desperate Prayer hp%")]
        [Description("Cast Desperate Prayer if we lower than % hp")]
        public int DesperatePrayerPercent { get; set; }

        [Setting]
        [DefaultValue(60)]
        [Category("PRAYER OF HEALING")]
        [DisplayName("Prayer Of healing/Clarity hp%")]
        [Description("Cast Prayer Of Healing or Clarity if talented if player lower than % hp >= PrayerOfHealingNumber")]
        public int PrayerOfHealingPercent { get; set; }

        [Setting]
        [DefaultValue(4)]
        [Category("PRAYER OF HEALING")]
        [DisplayName("Prayer Of healing/Clarity players number")]
        [Description("Cast Prayer Of Healing or Clarity if talented if player lower than PrayerOfHealingPercent >= this value")]
        public int PrayerOfHealingNumber { get; set; }

        [Setting]
        [DefaultValue(90)]
        [Category("PRAYER OF HEALING")]
        [DisplayName("Prayer Of healing Hp with 2 serendipity")]
        [Description("If 2 stack of serendipity: Cast Prayer Of Healing if player lower than % hp >= TwoSerendipityPrayerOfHealingNumber")]
        public int TwoSerendipityPrayerOfHealingPercent { get; set; }

        [Setting]
        [DefaultValue(3)]
        [Category("PRAYER OF HEALING")]
        [DisplayName("Prayer Of healing players number with 2 serendipity")]
        [Description("If 2 stack of serendipity: Cast Prayer Of Healing if player lower than TwoSerendipityPrayerOfHealingPercent >= this value")]
        public int TwoSerendipityPrayerOfHealingNumber { get; set; }

        [Setting]
        [DefaultValue(75)]
        [Category("PRAYER OF HEALING")]
        [DisplayName("Prayer Of healing Hp with 1 serendipity")]
        [Description("If 1 stack of serendipity: Cast Prayer Of Healing if player lower than % hp >= OneSerendipityPrayerOfHealingNumber")]
        public int OneSerendipityPrayerOfHealingPercent { get; set; }

        [Setting]
        [DefaultValue(3)]
        [Category("PRAYER OF HEALING")]
        [DisplayName("Prayer Of healing players number with 1 serendipity")]
        [Description("If 1 stack of serendipity: Cast Prayer Of Healing if player lower than OneSerendipityPrayerOfHealingPercent >= this value")]
        public int OneSerendipityPrayerOfHealingNumber { get; set; }

        [Setting]
        [DefaultValue(85)]
        [Category("AOE HEAL")]
        [DisplayName("Cascade/Halo/DivineStar %hp")]
        [Description("Cast Cascade/Halo if player lower than % hp >= CascadeHaloDivineStarNumber")]
        public int CascadeHaloPercent { get; set; }

        [Setting]
        [DefaultValue(3)]
        [Category("AOE HEAL")]
        [DisplayName("Cascade/Halo/DivineStar players number")]
        [Description("Cast Cascade/Halo if player lower than CascadeHaloDivinestarPercent >= this value")]
        public int CascadeHaloNumber { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("TANK")]
        [DisplayName("RenewAlwaysActiveOnTank")]
        [Description("try keep Renew always active on tank")]
        public bool RenewAlwaysActiveOnTank { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("TANK")]
        [DisplayName("Priorize Tank Healing")]
        [Description("Priorize Tank healing over all except an SoS heal")]
        public bool PriorizeTankHealing { get; set; }

        [Setting]
        [DefaultValue(99)]
        [Category("HEAL TUNING")]
        [DisplayName("Renew hp%")]
        [Description("Cast Renew at hp%")]
        public int RenewPercent { get; set; }

        [Setting]
        [DefaultValue(20)]
        [Category("REST")]
        [DisplayName("Drink mana%")]
        [Description("Drink at % mana")]
        public int ManaPercent { get; set; }

        [Setting]
        [DefaultValue(0)]
        [Category("REST")]
        [DisplayName("Eat hp%")]
        [Description("Eat at % hp")]
        public int HealthPercent { get; set; }

        [Setting, DefaultValue(Keys.None)]
        [Category("HOTKEY")]
        [DisplayName("PauseKey")]
        [Description("enable/disable Routine")]
        public Keys PauseKey { get; set; }

        [Setting, DefaultValue(Keys.None)]
        [Category("HOTKEY")]
        [DisplayName("HWSanctuaryOnHotkey")]
        [Description("Cast HW:Sanctuary On mouse position")]
        public Keys HWSanctuaryOnHotkey { get; set; }

        [Setting, DefaultValue(Keys.None)]
        [Category("HOTKEY")]
        [DisplayName("MassDispellOnHotkey")]
        [Description("Cast Mass Dispell On mouse position")]
        public Keys MassDispellOnHotkey { get; set; }

        [Setting, DefaultValue(Keys.None)]
        [Category("HOTKEY")]
        [DisplayName("DivineHymnOnHotkey")]
        [Description("Cast DivineHymn")]
        public Keys DivineHymnOnHotkey { get; set; }
        
        [Setting, DefaultValue(Keys.None)]
        [Category("HOTKEY")]
        [DisplayName("Blanket_RENEW_Hotkey")]
        [Description("Will spam RENEW : only if no SOS heal needed and no tank/offTank heal needed!!")]
        public Keys Blanket_RENEW_Hotkey { get; set; }

        [Setting, DefaultValue(Keys.None)]
        [Category("HOTKEY")]
        [DisplayName("Chance_CHAKRA_Hotkey")]
        [Description("Change Chakra: serenity->sanctuary and viceversa")]
        public Keys Chance_CHAKRA_Hotkey { get; set; }

        [Setting, DefaultValue(Keys.None)]
        [Category("HOTKEY")]
        [DisplayName("Change_NPC_Healing_Hotkey")]
        [Description("Enable/Disable NPC Healing")]
        public Keys Change_NPC_Healing_Hotkey { get; set; }

        [Setting, DefaultValue(Keys.None)]
        [Category("HOTKEY")]
        [DisplayName("PrecombatHotkey")]
        [Description("start a 60 sec procedure of PoM & renew spam")]
        public Keys PrecombatHotkey { get; set; }
        
    }
}